package com.xiao.androidcompose01.utils

import java.util.regex.Pattern

object StringUtils {
   fun CharSequence?.isPhone():Boolean{
//    val regEx = "^((13[0-9])|(145)(147)|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\\d{8}|(1709)\\d{7}\$"
      val regEx = "^1[3-9]\\d{9}$"
//     val 移动 = "^((13[4-9])|(147)|(15[0-2,7-9])|(178)|(18[2-4,7-8]))\\d{8}|(1705)\\d{7}$"
//    val 联通 = "^((13[0-2])|(145)|(15[5-6])|(176)|(18[5,6]))\\d{8}|(1709)\\d{7}$"
//     val 电信 = "((133)|(153)|(177)|(18[0,1,9]))\\d{8}$"
      //
      if (this==null)return false
      return Pattern.compile(regEx).matcher(this.toString()).matches()
   }
}